#include <vector>

using namespace std;

class Solution
{
public:
    vector<vector<int>> ret;
    vector<int> tmp;
    void dfs(int x, vector<int> &nums)
    {
        if (x == nums.size())
        {
            ret.push_back(tmp);
            return;
        }
        //选择当前位置
        tmp.push_back(nums[x]);
        dfs(x + 1, nums);
        tmp.pop_back();
        //不选当前位置
        dfs(x + 1, nums);
    }
    vector<vector<int>> subsets(vector<int> &nums)
    {
        dfs(0, nums);
        return ret;
    }
};

